<?php
require_once("vcl/vcl.inc.php");
require_once("lib/db_connection.php");
//Includes
use_unit("forms.inc.php");
use_unit("extctrls.inc.php");
use_unit("stdctrls.inc.php");

//Class definition
class Unit1 extends Page
{
       public $hiddenStyle = null;
       public $hiddenTemp = null;
       function Unit1Create($sender, $params)
       {
       $template = $_GET['template_id'];
       $style = $_GET['style'];
       $this->hiddenTemp->setValue($template);
       $this->hiddenStyle->setValue($style);

       $result_template = mysql_query("delete from template_tbl where template_id='".$this->hiddenTemp->getValue()."'")
       or die(mysql_error());

       $result_recurring = mysql_query("delete from template_recurring_tbl where template_id='".$this->hiddenTemp->getValue()."'")
       or die(mysql_error());

       mysql_query("delete from veh_reminder_tbl where template_id='".$this->hiddenTemp->getValue()."'")
       or die(mysql_error());

       redirect('template_list.php?company_id='.$_SESSION['company_id']);
       }

}

global $application;

global $Unit1;

//Creates the form
$Unit1=new Unit1($application);

//Read from resource file
$Unit1->loadResource(__FILE__);

//Shows the form
$Unit1->show();

?>